package com.example.mongodb.mongodb;

import org.springframework.data.domain.Page;
import org.springframework.data.geo.GeoResult;

import java.util.List;

/**
 * @author : zhayh
 * @Date : 2021-5-16 20:54
 * @Description:
 */
public interface RestaurantDocService {
    // 获取所有餐厅数据
    Page<RestaurantDoc> getAllRestaurants(Integer page, Integer size);

    // 添加餐厅数据
    RestaurantDoc addRestaurant(RestaurantDoc restaurantDoc) throws Exception;

    // 更新餐厅数据
    RestaurantDoc updateRestaurant(RestaurantDoc restaurantDoc) throws Exception;

    // 根据餐厅Id删除餐厅数据
    Boolean deleteRestaurant(Long dataId);

    // 根据关键字进行全文检索
    Page<RestaurantDoc> getRestaurantsByKeywords(String keywords, Integer page, Integer size);

    // 根据地理位置指定距离的餐厅数据
    List<GeoResult<RestaurantDoc>> getRestaurantsByPosition(Double lon, Double lat, Long distance);
}
